<template>
    <view class="popup" v-show="show">
        <view class="popup-info">
            <view class="popup-title"> {{ popupText.name }}</view>
            <view class="popup-text">{{ popupText.text }}</view>
            <view class="popup-btn">
                <!-- <view class="btn-left" @click="cancel">取消</view> -->
                <view class="btn-right" @click="confirm">收到</view>
            </view>
        </view>
    </view>
</template>

<script setup>
import { watch, defineProps, defineEmits } from 'vue';

const props = defineProps({
    show: {
        type: Boolean
    },
    popupText: {
        type: Object
    }

})
watch(props, (val) => {
    console.log(val);
})

// 使用defineEmits创建名称，接受一个数组
const emit = defineEmits(['confirm'])
function confirm() {
    emit('confirm', false)
}


</script>

<style lang="scss">
@import './index.scss';
</style>
